PDA - PDF Processor

PDF Processor Application

The Pentagon PDF processor has been designed to enable fast workflows by allowing specific text on a drawing or document to be automatically edited as part of a workflow without having to revert to the originating application. This is very useful in industries where the approval process requires additional data to be added to the document such as the status, approver's initials, publishing purpose, etc.

Other systems require you to identify zones on a PDF that contain the text to change. This is limiting as:

  • You need to manually teach it where the text is for every template you use
  • You need to link the output document to the template so that the editor knows where to look
  • Scaling causes problems. For example if a user creates PDFs of the same document at differing paper sizes

With Pentagon's PDF processor the details of the original text are harvested from the source document (Revit parameters and AutoCAD atributes) and are then embedded in the PDF. As each PDF knows where its text is, users can select multiple drawings with differing scales and papers sizes and then batch edit them.

Pentagon Help resources:

Pentagon Product Help

PentagonDocs Assistant

PentagonMail Assistant

Help for specific Applications: (these will open in a new browser window)

Core Script Library

DWG Processor

Extranet Uploader

Notifications Processor

PDF Processor (you are here)

Transmittals

Copyright © Pentagon Solutions Ltd. All Rights Reserved.


Installation

Expand this section for details.


Prerequisites

Installation ››

You will need Pentagon PDF processor version 5_0_1_0 or later installed on the your vault.

Revit users will need to be running the PentagonDocs Assistant Client version 5_0_63_0 or later.

The PDF Processor is only distributed as part of PentagonDocs Assistant, so please refer to the main PentagonDocs Assistant documentation for installation of both client and server components


Licensing

Installation ››

The PDF Processor is only distributed as part of PentagonDocs Assistant, so please refer to the main Pentagon DOCS documentation for licensing.


Quick Start Guide

Installation ››

Before you dive into this

Before you dive into setting this up, please invest time in reading and understanding this section as it could save you a lot of wasted time.

How does it work

Our Publishing tool in Revit records the: location, font, justification, orientation, etc., of the text into a non-printing part of the PDF file format so that, when you later wish to bulk edit the revision of a selection of drawings you can simply update the metadata in M-Files and our server-side prost-processor will change the text of both PDFs and DWGs without launching either Revit or AutoCAD, and it will preserve the: justification, orientation, font, etc. This typically takes 2 seconds per drawing.

Special types of text objects

In AutoCAD and Revit you can have both dumb text and intelligent text. The latter is not 'intelligent' in the literal sense but it does possess extra properties that make it ideal for these situations (e.g. attribute name). It is therefore common practice for title blocks to be built using these more versatile types of text as the user can then control them with more precision and ease.

AutoCAD has the concept of 'Attributes' and Revit has the concept of 'parameters' which can then control the text in a 'family'.

Assumptions

We assume that you know how to create blocks with attributes in AutoCAD and families with shared parameters in Revit.

In this documentation we have also assumed that you want to export both PDFs and DWGs of a Revit sheet so that you can subsequently edit both of them, as most customers wish to do this.

Use the same name

Make sure that for each text object you use the same naming. Whilst it is possible for some of the names in the table below to differ from each other, don't do it. Changing even the 'prompt' and 'default' for an AutoCAD attribute can lead to errors that are difficult to trace.

As AutoCAD attributes can’t have spaces, we recommend that for any given property you: use the same name, that it’s all UPPERCASE and with no spaces or special characters e.g. PROJECTNUMBER i.e.

Revit
Shared Parameter Name | PROJECTNUMBER
Sample Value | PROJECTNUMBER
AutoCAD
Tag | PROJECTNUMBER
Prompt | PROJECTNUMBER
Default | PROJECTNUMBER

For example in Revit:

And in AutoCAD:

Templates

The templates for the Revit family and the AutoCAD sheet drawing must share the same name. They must also be in your M-Files vault, accessible to all the staff that need to use them, and have the Is Template property set to 'True'.

As the DWG version of the drawing sheet needs to graphically match the one in Revit, you will need to take care to ensure that the placement of linework and text is identical.

Map Revit parameters to M-Files properties

Once your Revit family and AutoCAD template are ready, you can then map them to M-Files properties .

Publishing from Revit

You can now publish sheets from Revit that have the hidden data allowing them to be post-processed by the server.

From the PentagonDocs Assistant ribbon menu in Revit, select Publish Sheets.

The Publish Sheets dialogue will by default, only list those sheets that are in the WIP state. Select one or more sheets, check the boxes for DWG and DWG output and then select Publish to PentagonDocs Assistant.

If you have selected more than one output format, a multi-file document will be created in M-Files containing both files.

You can now use event handlers or workflow transitions in M-Files to call the script functions to update the text based on the current metadata.


Downloads & Change Log

Installation ››

The PDF Processor is not available for direct download. Please contact Symetri via support@symetri.co.uk for assistance.


Mapping attributes and parameters to M-Files properties

Expand this section for details.


Overview

Mapping attributes and parameters to M-Files properties ››

To synchronise properties in your drawing sheets with properties in M-Files you will need to map them via the PentagonDocs Assistant Administration Utility, which can be installed on any client P.C. If the utility is not on your P.C. re-run the installer.

To change the settings, your user account must have the Change metadata structure administrative right to the vault.

When first accessing the Pentagon Administration Utility, you will be prompted to open a vault using your available M-Files connections. Subsequently, you may open vaults from the menu.

Navigate to a topic using the browser on the left before pressing Edit to make changes. Press OK, Cancel or Apply as required to navigate to another topic or exit.

For details on each topic in the browser, see the subsequent help pages.


Revit configuration

Mapping attributes and parameters to M-Files properties ››

Add mappings to populate Revit Shared Parameter values using M-Files metadata

Sync direction can be selected for each property.

Properties are synchronised during document processing and can be manually synchronised using the PentagonDocs Assistant ribbon in Revit.


AutoCAD configuration

Mapping attributes and parameters to M-Files properties ››

Property Mappings

The DWG Property Synchronisation uses DWG Blocks and Attributes to change textual content in the drawing. In order for this to work, it must first be configured for each Vault. The configuration settings are edited using the 'PentagonDocs Assistant Administration Utility' and the 'Property Mappings' node under 'DWG Processor' in the configuration tree.

Upon selection of the node, you are presented with the configuration options as shown below. The settings can be edited and applied using the buttons in the bottom right corner.

To define which DWG blocks are supported, enter their names in the 'Title Block Names' property.

TIP: Multiple block names can be added using a semi-colon (;) as a separator e.g. STANDARD-TITLE; CUSTOM-TITLE

A mapping can be created between an M-Files property and an DWG attribute by clicking the 'Add Mapping' button. This displays the property tree as shown below. Mappings can be made using both direct and indirect properties defined within the selected Vault.

NOTE: Direct properties are those directly associated with the Class the drawing belongs to, these are displayed as root nodes in the property tree. Indirect properties are from linked objects and sub-objects, these are displayed as child nodes in the property tree.

Fill out the 'Attribute' name, and click 'Add' to create the new mapping. Only one mapping per Attribute tag can be created.

TIP: Mappings can be edited or deleted using the 'Edit Mapping' and 'Delete Mapping' buttons.

When all the Block Names and Property Mappings have been entered, click 'OK' or 'Apply' to save the changes.


Workflow management

Expand this section for details.


Example BeforeCheckInChangesFinalize event handler script

Workflow management ››

The following example script is typical of what you might put into a BeforeCheckInChangesFinalize event handler in order to update both PDFs and DWGs when the user edits properties on a metadata card that relate to title block fields:

dim scriptLib : set scriptLib = GetExtensionObject("PentagonDOCS.Core.ScriptLibrary")

dim pdfProcessor : set pdfProcessor = GetExtensionObject("PentagonDOCS.PDFProcessor")

dim dwgProcessor : set dwgProcessor = GetExtensionObject("PentagonDOCS.DWGProcessor")

pdfProcessor.WriteLog "PDFProc","Checking file extension"

if scriptLib.IsFileExtension(Vault,ObjVer,".pdf") then

pdfProcessor.WriteLog "PDFProc","File is PDF"

pdfProcessor.SyncPropertiesFromMFiles Vault, ObjVer,"PDFProc"

end if

pdfProcessor.WriteLog "DWGProc","Checking file extension"

if scriptLib.IsFileExtension(Vault,ObjVer,".dwg") then

dwgProcessor.WriteLog "DWGProc","File is DWG"

dwgProcessor.SyncPropertiesFromMFiles Vault, ObjVer,"DWGProc"

end if


Troubleshooting

Expand this section for details.


Cached files

Troubleshooting ››

On each user’s machine in C:\ProgramData\PentagonDocs Assistant\Revit you will find a file called SheetLocationCache.dat

As the name suggests, this file caches the locations of the shared parameter text so that each publish process does not need to find the positions each time. This improves the publishing performance. If you have changed your title block layouts you will need to clear this cache. You can do this by either deleting the file or from the PentagonDocs Assistant ribbon menu in Revit select Settings and then Clear PDF Cache...


Weird behaviours

Troubleshooting ››

If you get weird behaviours such as files purporting to be PDFs when they are actually DWGs and are not renditions of the document they claim to be generated from, it’s usually due to M-Files cache. This is only likely to happen in virtualised test environments where resetting to a snapshot of the vault is not matched by clearing the local cache on the client. To do this:

  1. Right-click the M-Files tray icon and select Settings then M-Files Desktop Dettings
  2. Select the Settings tab
  3. Pick the Computer-specific Settings button
  4. Pick the Destroy Local Data button
  5. Select the appropriate vault and then select Destroy

You will need to re-start the client which may take a while as it will have to download the client apps from the server.


Text is misaligned or duplicates are overlapping each other

Troubleshooting ››

If you have updated the Revit sheet’s family and the placement of text has changed, the cache will need to be refreshed.

See the section on Cached Files to clear the cache.


Log files

Troubleshooting ››

Log Files

The PDF Processor has the ability to generate log files during its operation. By supplying the LogIdentifer parameter to the various script functions, a log file is automatically created or appended to. The LogIdentifier determines the filename of the resulting log file. Typically these would by based on the current activity or transaction, thereby creating separate log files for each event.

The log files are useful when trying to determine why a particular function might have failed. The WriteLog function provides the ability to include custom log entries to help debug script related issues.

The log files are created on the M-Files server in the following location:

C:\ProgramData\PentagonDocs Assistant\Server Logs\<Vault Name> <Vault GUID>

Each vault with the PDF Processor installed will have its own Server Logs sub folder based on the display name of the vault and its globally unique identifier (GUID).

Example Log File

Filename: {8056887D-1C6E-413C-994C-48AAB14219A3}.log

01/01/2019 09:00:00:5562 - Vault Extension Method: ExDOCS_WriteAttributes_DWG

01/01/2019 09:00:00:5862 - Checking Out...

01/01/2019 09:00:00:6482 - DWG File Count: 1

01/01/2019 09:00:00:6492 - Creating RealDWG COM Object. (dllhost.exe)

01/01/2019 09:00:01:2083 - Call SyncPropertiesFromMFiles COM method.

01/01/2019 09:00:01:3183 - Processing Object: ID 1 Version 2

01/01/2019 09:00:01:3353 - FileVer: ID 1 Version 2

01/01/2019 09:00:01:3353 - Download DWG to temp file: C:\ProgramData\PentagonDocs Assistant\DWG Processor\Temp\4yx2uhha.dwg

01/01/2019 09:00:01:3973 - Download failed: The file has not been committed yet.

01/01/2019 09:00:01:3973 - Attempting to Download previous File Version

01/01/2019 09:00:01:4093 - FileVer: ID 1 Version 1

01/01/2019 09:00:01:4093 - Download DWG to temp file: C:\ProgramData\PentagonDocs Assistant\DWG Processor\Temp\4yx2uhha.dwg

01/01/2019 09:00:01:4453 - Open DWG file

01/01/2019 09:00:01:5483 - Update attribute values of matching Titleblocks

01/01/2019 09:00:01:6333 - Save DWG file

01/01/2019 09:00:02:1063 - Upload updated DWG file

01/01/2019 09:00:02:1443 - Delete temp files from server

01/01/2019 09:00:02:1453 - Releasing COM object.

01/01/2019 09:00:02:1453 - Set Modifying User

01/01/2019 09:00:02:1783 - Checking In...

Automatic Removal of Log Files

Because the creation of log files can be based on an activity or transaction, the number of log files can quickly accumulate. The PDF Processor will automatically remove log files older than 24 hours.

This setting can be increased or decreased by changing the following registry entry:

Registry Key | HKEY_LOCAL_MACHINE\SOFTWARE\PentagonDOCS\Server
Value Name | DeleteLogFilesAfterHours
Type | REG_DWORD
Default | 0x00000018 (24) 24 Hours

NOTE: Changing this value does not require the vault to be restarted.


Script Functions

Copyright © Pentagon Solutions Ltd. All Rights Reserved.


WriteLog

Script Functions ››

WriteLog Method

Description

Writes a custom message to a log file.

Please see Log Files for more information.

Syntax

Sub WriteLog(LogIdentifier As Object, Message As Object)

Parameters

Name | Data Type | Description
LogIdentifier | String or TypedValue | Used to determine the filename of the log file. To create a log file for the current activity pass in the provided ActivityID.
Message | Object | A String or Object to write to the log file. If an object is specified, it must be convertible to String.

Return

No return value.

Example

'create PentagonDOCS PDF Processor object
Set pdfProcessor = GetExtensionObject("PentagonDOCS.PDFProcessor")

'write to log

pdfProcessor.WriteLog ActivityID, "Message 1"

pdfProcessor.WriteLog ActivityID, "Message 2"

pdfProcessor.WriteLog ActivityID, "Message 3"

The resulting log file would contain the following information:

01/01/2021 09:00:00:8802 - Message 1

01/01/2021 09:00:00:8922 - Message 2

01/01/2021 09:00:00:8932 - Message 3


SyncPropertiesFromMFiles

Script Functions ››

SyncPropertiesFromMFiles Method

Description

Updates the text in a PDF based on the object's properties in M-Files.

A log file is generated if a LogIdentifier is provided, no log file is created if the LogIdentifier is Nothing. Please see Log Files for more information.

WARNING: The specified object must be in a Checked Out state

If no PDF files exists in the specified object, then an error is raised.

Syntax

Sub SyncPropertiesFromMFiles(Vault As Vault, DrawingObjVer As ObjVer, LogIdentifier As Object)

Parameters

Name

Data Type

Description

Vault

Vault

The Vault object provided by the event handler.

DrawingObjVer

ObjVer

ObjVer of object containing a DWG file to process. This could be provided by the event handler or created dynamically using CreateObject("MFilesAPI.ObjVer").

The ObjVer is also the target for the generated PDF file. Single File Document (SFD) objects will automatically be converted to Multi File Document (MFD) objects.

LogIdentifier

String or TypedValue

Used to determine the filename of the log file. To create a log file for the current activity pass in the provided ActivityID. If this parameter is Nothing, then no log file is generated.

Return

No return value.

Example

'create PentagonDOCS PDF Processor object

Set pdfProcessor = GetExtensionObject("PentagonDOCS.PDFProcessor")

'Update the PDF Rendition with the current metadata values

pdfProcessor.SyncPropertiesFromMFiles Vault, ObjVer, ActivityID

The resulting log file would contain something similar to this:

Calling SyncingPropertiesFromMFiles

Processing ObjVer: {"objType":0,"id":2918,"version":66}

Downloading file to temp: C:\ProgramData\PentagonDocs Assistant\PDF Processor\Temp\ncbejkra.pdf

Syncing property: REVISIONNUMBER value: P06.04

Syncing property: SUITABILITY DESCRIPTION value: S0 - WIP

Syncing property: CLIENT value: Gloucester County Council

Syncing property: PROJECTNUMBER value: J0933

Syncing property: PROJECTTITLE value: Chopin Music School

Syncing property: TITLE1 value: East & West Elevations

Syncing property: TITLE2 value: HELLO

Property has not changed

Calling SetTextValue

Checking attribute: TITLE2 has locations

Locations information found

Calling SetTextAtLocation

Processing page 1

Processing location #0

Search Boundaries: 2183.36369747125 295.333099373665 2270.54156795083 307.309726723519

Fontname: Helvetica

Fontsize: 11.9766273498535

Checking for missing font information

New value length: 39.2713610801697

Max wrap width: 263.271013395452

Wordwrap enabled: True

Removing existing fragments

Fragment text: HELLO WORLD

Does fragment text match a previous value: True

New Fragment xIndent: 2183.36369747125

New Fragment yIndent: 295.333099373665

New String: HELLO

Current position: 2183.36369747125 295.333099373665

Horizontal justification: Center

Center: 2207.31695217095 295.333099373665

New Search boundary: 2207.31695217095 295.333099373665 2246.58831325112 307.309726723519

Syncing property: TITLE3 value:

Syncing property: DRAWDATE value: 11/2/2020

Syncing property: SUITABILITY value: S0

Syncing property: DRAWING_NUMBER value: J0933-EXC-ZZ-ZZ-DR-A-0004

Syncing property: DRAWBY value: SG

Syncing property: WATERMARK2 value:

Syncing property: STATUS value: DESIGN INTENT

Syncing property: FILETYPE value:


Will I have to teach it where the text is on each drawing?

FAQs ››

No, the software finds the text based on ‘parameters’ in Revit and ‘attribute tags’ in DWG files.


Will this work with AutoCAD LT?

FAQs ››

No, AutoCAD LT is not able to run the code to provide the publishing methods. However you do not need to publish with PDF Chameleon to achieve similar results as our DWG Processor enables you to edit attributes and create PDFs from any DWG.


FAQs

 Redirecting... click here if nothing happens